3.148 \(\int \frac{\tan ^2(a+i \log (x))}{x^2} \, dx\)

Optimal. Leaf size=60 \[ \frac{3 x}{x^2+e^{2 i a}}+\frac{e^{2 i a}}{x \left (x^2+e^{2 i a}\right )}+2 e^{-i a} \tan ^{-1}\left (e^{-i a} x\right ) \]

[Out]

E^((2*I)*a)/(x*(E^((2*I)*a) + x^2)) + (3*x)/(E^((2*I)*a) + x^2) + (2*ArcTan[x/E^(I*a)])/E^(I*a)

________________________________________________________________________________________

Rubi [F]  time = 0.0491912, antiderivative size = 0, normalized size of antiderivative = 0., number of steps used = 0, number of rules used = 0, integrand size = 0, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0., Rules used = {} \[ \int \frac{\tan ^2(a+i \log (x))}{x^2} \, dx \]

Verification is Not applicable to the result.

[In]

Int[Tan[a + I*Log[x]]^2/x^2,x]

[Out]

Defer[Int][Tan[a + I*Log[x]]^2/x^2, x]

Rubi steps

\begin{align*} \int \frac{\tan ^2(a+i \log (x))}{x^2} \, dx &=\int \frac{\tan ^2(a+i \log (x))}{x^2} \, dx\\ \end{align*}

Mathematica [A]  time = 0.108788, size = 72, normalized size = 1.2 \[ \frac{2 x (\cos (a)-i \sin (a))}{\left (x^2+1\right ) \cos (a)-i \left (x^2-1\right ) \sin (a)}+2 \cos (a) \tan ^{-1}(x (\cos (a)-i \sin (a)))-2 i \sin (a) \tan ^{-1}(x (\cos (a)-i \sin (a)))+\frac{1}{x} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[a + I*Log[x]]^2/x^2,x]

[Out]

x^(-1) + 2*ArcTan[x*(Cos[a] - I*Sin[a])]*Cos[a] - (2*I)*ArcTan[x*(Cos[a] - I*Sin[a])]*Sin[a] + (2*x*(Cos[a] -
I*Sin[a]))/((1 + x^2)*Cos[a] - I*(-1 + x^2)*Sin[a])

________________________________________________________________________________________

Maple [F]  time = 0.05, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( \tan \left ( a+i\ln \left ( x \right ) \right ) \right ) ^{2}}{{x}^{2}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(a+I*ln(x))^2/x^2,x)

[Out]

int(tan(a+I*ln(x))^2/x^2,x)

________________________________________________________________________________________

Maxima [B]  time = 1.6189, size = 312, normalized size = 5.2 \begin{align*} \frac{6 \, x^{2} -{\left (x^{3}{\left (2 \, \cos \left (a\right ) - 2 i \, \sin \left (a\right )\right )} +{\left ({\left (2 \, \cos \left (a\right ) - 2 i \, \sin \left (a\right )\right )} \cos \left (2 \, a\right ) + 2 \,{\left (i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} x\right )} \arctan \left (\frac{2 \, x \cos \left (a\right )}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}, \frac{x^{2} - \cos \left (a\right )^{2} - \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) +{\left (x^{3}{\left (-i \, \cos \left (a\right ) - \sin \left (a\right )\right )} +{\left ({\left (-i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \cos \left (2 \, a\right ) +{\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} x\right )} \log \left (\frac{x^{2} + \cos \left (a\right )^{2} + 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) + 2 \, \cos \left (2 \, a\right ) + 2 i \, \sin \left (2 \, a\right )}{2 \, x^{3} + x{\left (2 \, \cos \left (2 \, a\right ) + 2 i \, \sin \left (2 \, a\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x))^2/x^2,x, algorithm="maxima")

[Out]

(6*x^2 - (x^3*(2*cos(a) - 2*I*sin(a)) + ((2*cos(a) - 2*I*sin(a))*cos(2*a) + 2*(I*cos(a) + sin(a))*sin(2*a))*x)
*arctan2(2*x*cos(a)/(x^2 + cos(a)^2 - 2*x*sin(a) + sin(a)^2), (x^2 - cos(a)^2 - sin(a)^2)/(x^2 + cos(a)^2 - 2*
x*sin(a) + sin(a)^2)) + (x^3*(-I*cos(a) - sin(a)) + ((-I*cos(a) - sin(a))*cos(2*a) + (cos(a) - I*sin(a))*sin(2
*a))*x)*log((x^2 + cos(a)^2 + 2*x*sin(a) + sin(a)^2)/(x^2 + cos(a)^2 - 2*x*sin(a) + sin(a)^2)) + 2*cos(2*a) +
2*I*sin(2*a))/(2*x^3 + x*(2*cos(2*a) + 2*I*sin(2*a)))

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{{\left (x e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} + x\right )}{\rm integral}\left (-\frac{e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} - 1}{x^{2} e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} + x^{2}}, x\right ) + 2}{x e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} + x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x))^2/x^2,x, algorithm="fricas")

[Out]

((x*e^(2*I*a - 2*log(x)) + x)*integral(-(e^(2*I*a - 2*log(x)) - 1)/(x^2*e^(2*I*a - 2*log(x)) + x^2), x) + 2)/(
x*e^(2*I*a - 2*log(x)) + x)

________________________________________________________________________________________

Sympy [A]  time = 0.672558, size = 51, normalized size = 0.85 \begin{align*} \frac{3 x^{2} + e^{2 i a}}{x^{3} + x e^{2 i a}} - \left (i \log{\left (x - i e^{i a} \right )} - i \log{\left (x + i e^{i a} \right )}\right ) e^{- i a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*ln(x))**2/x**2,x)

[Out]

(3*x**2 + exp(2*I*a))/(x**3 + x*exp(2*I*a)) - (I*log(x - I*exp(I*a)) - I*log(x + I*exp(I*a)))*exp(-I*a)

________________________________________________________________________________________

Giac [A]  time = 1.21748, size = 99, normalized size = 1.65 \begin{align*} 2 \,{\left (\arctan \left (x e^{\left (-i \, a\right )}\right ) e^{\left (-3 i \, a\right )} + \frac{x e^{\left (-2 i \, a\right )}}{x^{2} + e^{\left (2 i \, a\right )}}\right )} e^{\left (2 i \, a\right )} + \frac{5}{x{\left (\frac{e^{\left (2 i \, a\right )}}{x^{2}} + 1\right )}} + \frac{e^{\left (2 i \, a\right )}}{x^{3}{\left (\frac{e^{\left (2 i \, a\right )}}{x^{2}} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x))^2/x^2,x, algorithm="giac")

[Out]

2*(arctan(x*e^(-I*a))*e^(-3*I*a) + x*e^(-2*I*a)/(x^2 + e^(2*I*a)))*e^(2*I*a) + 5/(x*(e^(2*I*a)/x^2 + 1)) + e^(
2*I*a)/(x^3*(e^(2*I*a)/x^2 + 1))